text: Set the readonly accessible property
authorMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 03:34:36 +0000 (23:34 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 19:10:40 +0000 (15:10 -0400)
This mirrors what we already do for GtkTextView.

gtk/gtktext.c

index 6910aeff8b68e7aa95bf88570f5d8124ae287fca..e57836ee1092a6ad8e283563375cdafaa11a4dca 100644 (file)
@@ -1482,6 +1482,7 @@ gtk_text_class_init (GtkTextClass *class)
                                        "text.redo", NULL);
 
   gtk_widget_class_set_css_name (widget_class, I_("text"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TEXT_BOX);
 }
 
 static void
@@ -5430,6 +5431,10 @@ gtk_text_set_editable (GtkText  *self,
       gtk_text_update_clipboard_actions (self);
       gtk_text_update_emoji_action (self);
 
+      gtk_accessible_update_property (GTK_ACCESSIBLE (self),
+                                      GTK_ACCESSIBLE_PROPERTY_READ_ONLY, !priv->editable,
+                                      -1);
+
       g_object_notify (G_OBJECT (self), "editable");
     }
 }